package com.ttg.web.dao.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttg.common.entities.BasePage;
import com.ttg.model.dto.job.ModelAcctPageDTO;
import com.ttg.model.mapper.BankAccountPrimitiveMapper;
import com.ttg.model.pojo.BankAccountPrimitive;
import com.ttg.model.vo.AcctMctVipInfoVO;
import com.ttg.model.vo.AcctPrimitiveSumVO;
import com.ttg.model.vo.ModelAcctVO;
import com.ttg.model.vo.SettAcctTimeAmtVO;
import com.ttg.web.dao.BankAccountPrimitiveDao;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (TblBankAccountPrimitive) daoImpl
 *
 * @author chenyou
 * @datetime 2025-11-11 10:13:55
 */
@Service
public class BankAccountPrimitiveDaoImpl extends ServiceImpl<BankAccountPrimitiveMapper, BankAccountPrimitive> implements BankAccountPrimitiveDao {

    @Override
    public boolean deleteByDate(Integer date) {
        LambdaQueryWrapper<BankAccountPrimitive> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(BankAccountPrimitive::getDataTime,date);
        return remove(wrapper);
    }

    @Override
    public List<SettAcctTimeAmtVO> getSettAcctTimeAmt(Integer date, List<Long> acctNos) {
        return baseMapper.getSettAcctTimeAmt(date,acctNos);
    }

    @Override
    public List<AcctPrimitiveSumVO> getAcctInfoByMonth(Integer firstDay, Integer lastDay, List<Long> acctNos) {
        return baseMapper.getAcctInfoByMonth(firstDay,lastDay,acctNos);
    }

    @Override
    public BasePage<Long> getAcctNosByPage(ModelAcctPageDTO pageDTO) {
        return baseMapper.getAcctNosByPage(pageDTO.parse(),pageDTO);
    }

//    @Override
//    public List<ModelAcctVO> getSettAcctModel(Integer firstDay, Integer lastDay, List<Long> acctNos) {
//        return baseMapper.getAcctModel(firstDay, lastDay,0, acctNos);
//    }

    @Override
    public List<ModelAcctVO> getAllAcctModel(Integer firstDay, Integer lastDay, List<Long> acctNos) {
        return baseMapper.getAcctModel(firstDay, lastDay,null, acctNos);
    }

    @Override
    public List<AcctMctVipInfoVO> getMctVipInfoByActNos(Integer day, List<Long> acctNos) {
        return baseMapper.getMctVipInfoByActNos(day,acctNos);
    }
}

